import com.aliyuncs.exceptions.ClientException;
import com.itheima.utils.QiniuUtils;
import com.itheima.utils.SMSUtils;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.junit.Test;

import javax.xml.crypto.dsig.spec.SignatureMethodParameterSpec;
import java.io.FileOutputStream;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * @author xiaycbstart
 * @create 2019 12 21 16:27
 */
public class test {
    @Test
    public void test1(){
        QiniuUtils.upload2Qiniu("G:\\index.html","index.html");
    }
    @Test
    public void test2(){
        LocalDateTime localDateTime3 = LocalDateTime.now();
        System.out.println(localDateTime3);
    }
    @Test
    public void test3() throws Exception {
        //在内存中创建一个Excel文件
        XSSFWorkbook workbook = new XSSFWorkbook();
//创建工作表，指定工作表名称
        XSSFSheet sheet = workbook.createSheet("传智播客");
//创建行，0表示第一行
        XSSFRow row = sheet.createRow(0);
//创建单元格，0表示第一个单元格
        row.createCell(0).setCellValue("编号");
        row.createCell(1).setCellValue("名称");
        row.createCell(2).setCellValue("年龄");
        XSSFRow row2 = sheet.createRow(1);
        for (int i = 1; i <= 100000; i++) {
            XSSFRow row1 = sheet.createRow(i);
            row1.createCell(0).setCellValue("1");
            row1.createCell(1).setCellValue("小明");
            row1.createCell(2).setCellValue(i);
        }
//通过输出流将workbook对象下载到磁盘
        FileOutputStream out = new FileOutputStream("F:\\hello.xlsx");
        workbook.write(out);
        out.flush();
        out.close();
        workbook.close();
    }
    @Test
    public void test4(){
        //当地事件
        LocalDate localDate = LocalDate.now();
        System.out.println(localDate);
        //当地时间详细
        LocalDateTime localDateTime = LocalDateTime.now();
        System.out.println(localDateTime);
        //主动构造
        LocalDate localDate1=  LocalDate.of(1029,12,12);
        System.out.println(localDate1);
        LocalDate max = LocalDate.MAX;
        System.out.println(max);
        LocalDate min = LocalDate.MIN;
        System.out.println(min);
        System.out.println("..........");
        System.out.println(LocalDateTime.now());
    }
    @Test
    public void test() throws ClientException {
        SMSUtils.sendShortMessage(SMSUtils.VALIDATE_CODE,"18020042936","xiayc");
}
}
